package com.zhuss.car.car;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.car.car.DetailCarBo;
import com.zhuss.bean.bo.car.car.SearchCarBo;
import com.zhuss.common.ReadService;
import com.zhuss.car.processor.CarRead;
import com.zhuss.exception.DzcxException;

/**
 * @description: 车辆查询Service
 * @author: zhushanshuo
 * @create: Fri Dec 18 20:35:18 CST 2020
 **/
@Component("carReadService")
public class CarReadService implements ReadService<Object, Object> {

	@Autowired
	@Qualifier("carRead")
	private CarRead carRead;

	/**
	 * 详情
	 */
	@Override
	public Object detail(Object param) throws DzcxException {
		DetailCarBo bo = (DetailCarBo) param;
		Long carId = bo.getCarId();
		Object vo = carRead.detail(carId);
		return vo;
	}

	/**
	 * 列表
	 */
	@Override
	public Object list(Object param) throws DzcxException {
		SearchCarBo bo = (SearchCarBo) param;
		Object result = carRead.list(bo);
		return result;
	}

	/**
	 * 下拉车辆
	 */
	public Object selectByType(SearchCarBo bo) throws DzcxException {
		return carRead.selectByType(bo);
	}

}

